package dal

type ReserveRecord struct {
	ReserveID        int64  `gorm:"primaryKey" json:"reserve_id"`
	Consultant       string `gorm:"not null" json:"consultant"`
	Consulstate      int64  `gorm:"not null" json:"consulstate"`
	ConsultDate      string `gorm:"not null"  json:"consult_date"`
	ConsultTime      string `gorm:"not null" json:"consult_time"`
	Weekday          string `gorm:"not null" json:"weekday"`
	Place            string `gorm:"not null" json:"place"`
	CancelReason     string `gorm:"" json:"cancel_reason"`
	Phonenumber      string `gorm:"not null" json:"phonenumber"`
	ReserveQuestion1 string `gorm:"" json:"reserve_question1"`
	ReserveQuestion2 string `gorm:"" json:"reserve_question2"`
	ReserveQuestion3 string `gorm:"" json:"reserve_question3"`
	ReserveQuestion4 string `gorm:"" json:"reserve_question4"`
	ReserveQuestion5 string `gorm:"" json:"reserve_question5"`
	ReserveQuestion6 string `gorm:"" json:"reserve_question6"`
	ReserveQuestion7 string `gorm:"" json:"reserve_question7"`
	StudentNum       string `gorm:"not null; type:varchar(10)" json:"studentNum"`
}

func (s *ReserveRecord) GetReserveRecord(num string) ([]ReserveRecord, error) {
	var reserveRecord []ReserveRecord
	return reserveRecord, DB.Where("student_num = ?", num).Find(&reserveRecord).Error
}
